/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.Comunicator;

import java.io.Serializable;
import java.util.ArrayList;

/**
 *
 * @author gonçalo.margalho
 */
public class Message implements Serializable {

    private String sender;
    private ArrayList<String> receiver = new ArrayList<String>();
    private Parameters<Element> parameters = new Parameters<Element>();
    private String action;

    public String getAction() {
        return action;
    }

    public void setAction(String action) {
        this.action = action;
    }

    public Parameters<Element> getParameters() {
        return parameters;
    }

    public void setParameters(Parameters<Element> parameters) {
        this.parameters = parameters;
    }

    public ArrayList<String> getReceiver() {
        return receiver;
    }

    public void setReceiver(ArrayList<String> receiver) {
        this.receiver = receiver;
    }

    public String getSender() {
        return sender;
    }

    public void setSender(String sender) {
        this.sender = sender;
    }

    public void addReceiver(String u) {
        this.receiver.add(u);
    }

    public void stampa() {
        System.out.println("----------");
        System.out.println(action);

        for (Element e : getParameters()) {
            System.out.println("--> " + e.getTitle() + ": " + e.getValue());
        }

        System.out.println("----------");
    }

    public void riempi() {
    }
}
